﻿namespace FlexField.Metadata
{
    /// <summary>
    /// Provides an abstraction for a validating a type.
    /// </summary>
    public interface IEntityValidator<TKey> where TKey : IEquatable<TKey>
    {
        /// <summary>
        /// Validates a type as an asynchronous operation.
        /// </summary>
        /// <param name="manager">The <see cref="MetadataManager{TKey}"/> managing the metadata schema.</param>
        /// <param name="entity">The type to validate.</param>
        /// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="MetadataResult"/> of the asynchronous validation.</returns>
        Task<MetadataResult> ValidateAsync(MetadataManager<TKey> manager, MetadataEntity<TKey> entity);
    }
}
